import router from '@/router'
import { setDocumentTitle } from '@/utils/commonUtil'
import { Site } from '@/config/config'

//路由前置守卫
router.beforeEach(async (to, from, next) => {
  if (to?.meta?.title) {
    setDocumentTitle((to.meta.title + " | " + Site.slogan) as string)
  }
  next()
})

router.afterEach(() => {
  document.getElementById('App-Container')?.focus()
})
